home *** CD-ROM | disk | FTP | other *** search
- /*
- File: OutboundUIMac.c
-
- Copyright (c) 1993-6, Adobe Systems Incorporated.
- All rights reserved.
-
- C source file for Mac Specific code for Outbound export module.
- */
-
- #include "Outbound.h"
-
- /*****************************************************************************/
-
- /* Displays the about dialog box for the plug-in module. */
-
- void DoAbout (GPtr globals)
- {
- ShowAbout (gStuff->hostSig, AboutID);
- }
-
- /*****************************************************************************/
-
- Boolean QueryForExportFile (GPtr globals)
- {
-
- Str255 prompt;
- StandardFileReply reply;
- FSSpec *specPtr;
- Boolean wasChanged;
- int32 gotErr = 0;
-
- gotErr = PISetSaveDirectory((Handle)gAliasHandle,
- gStuff->filename,
- gQueryForParameters,
- &gStuff->vRefNum);
- PIDisposeHandle((Handle)gAliasHandle); // it was handed to us, it's ours to dispose
-
- if (!gAliasHandle && !gQueryForParameters)
- return FALSE; // no alias and no query? Bad.
-
- gAliasHandle = NULL; // just in case
-
- if (!gQueryForParameters)
- return TRUE; // got the aliashandle
-
- /* Ask the user */
-
- PIGetString(prompt, kPrompt);
-
- StandardPutFile (prompt, gStuff->filename, &reply);
-
- if (!TSC (!reply.sfGood))
- return FALSE;
- else
- {
- specPtr = &reply.sfFile;
-
- if (!(gSameNames = (PISMatch(specPtr->name, (char *)gStuff->filename) != noMatch)))
- PICopy(gStuff->filename, specPtr->name, (specPtr->name[0]+1));
- // shove user-defined name into gStuff filename
-
- /* set gStuff->vRefNum as working directory (alias) from vRefNum
- from hard vRefNum/parID */
- PICloseAndOpenWD(specPtr->vRefNum, specPtr->parID, &gStuff->vRefNum);
-
- return TRUE;
- }
- }
-
- /*****************************************************************************/
-
- Boolean CreateExportFile (GPtr globals)
- {
- ResType creator;
- ResType type;
- Str255 s = "";
-
- PIGetString(s, kCreatorAndType);
- creator = PIChar2Type((char *)&s[1]);
- type = PIChar2Type((char *)&s[5]);
-
- return PICreateFile(gStuff->filename,
- gStuff->vRefNum,
- creator,
- type,
- &gFRefNum,
- &gResult);
- }
-
- /*****************************************************************************/
-
- Boolean CloseExportFile (GPtr globals)
- {
- return PICloseFile(gStuff->filename,
- gStuff->vRefNum,
- gFRefNum,
- gSameNames,
- &gStuff->dirty,
- &gAliasHandle,
- &gResult);
- }
-
- /*****************************************************************************/
-